//
//  YRNKHostingController.swift
//  YoruNeko
//
//  Created by hgc on 2021/6/24.
//

import Foundation
import SwiftUI

class YRNKHostingController<V: View>: YRNKHostingControllerPointer{
    
    var swiftUIView:V
     
    var viewController: UIViewController
     
    init(rootView:V,vc:UIViewController) {
      self.swiftUIView = rootView
      self.viewController = vc
    }
    
    func getViewController()->UIViewController{
        return viewController
    }
    
    func getViewType() -> ViewType {
        if swiftUIView is SearchView{
            return .SearchView
        }
        //..if else

        //no if match
        return .SomeView
        
        
    }
  }

  protocol YRNKHostingControllerPointer {
    func getViewController()->UIViewController
    func getViewType() -> ViewType
  }
